<%-- 
    Document   : userMaintenance
    Created on : Jun 12, 2012, 6:07:57 PM
    Author     : Owner
--%>

<%@include file="/jsp/adminTop.jsp" %>

<html>
    <head>
        <title>Manage Users</title>        
    </head>
    <body>
        <div class="clear"></div>
        <table border="1" cellspacing="10px" align="center" width="100%">
            <td style="vertical-align: top;" width="20%">
                <%@include file="/jsp/right.jsp" %>
            </td>
            <td style="vertical-align: top;" width="80%">
                <div class="page-title"><h1>Manage Users</h1></div>
                <table align="center" border="1" cellspacing="10px" width="100%" >
                    <tr>
                        <td align="right">
                            <html:form action="/userAccount" method="post">
                                <table align="center" border="1" cellspacing="5px">
                                    <tr>
                                        <td>
                                            <html:select property="userInfo">
                                                <html:option value="0">--Select--</html:option>
                                                <html:option value="1">First Name</html:option>
                                                <html:option value="2">Last Name</html:option>
                                                <html:option value="3">Email Id</html:option>
                                            </html:select>
                                        </td>
                                        <td><html:text property="searchUser"/></td>
                                        <td>
                                            <a onclick="javascript:searchUser('./userAccount.do?action=searchUser','userBean')">
                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                            </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">Status:
                                            <html:select property="accountStatusId">
                                                <html:option value="0">--Status--</html:option>
                                                <html:options collection="statusList" property="key" labelProperty="value"/>
                                            </html:select>
                                        </td>
                                        <td style="vertical-align: bottom;">
                                            <a onclick="javascript:searchUser('./userAccount.do?action=searchUserByStatus','userBean')">
                                                <img alt="Find" src="images/find.png" onmouseover="src='images/find-hover.png'" onmouseout="src='images/find.png'" />
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                            </html:form>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table border="1" cellspacing="10px" id="results" align="center" width="100%">
                                <colgroup>
                                    <col width="5%">
                                    <col width="35%">
                                    <col width="25%">
                                    <col width="10%">
                                    <col width="15">
                                    <col width="5%">
                                    <col width="5%">
                                </colgroup>
                                <tr>
                                    <td><strong>ID</strong></td>
                                    <td><strong>Name</strong></td>
                                    <td><strong>Email Id</strong></td>
                                    <td><strong>Created On</strong></td>
                                    <td><strong>Status</strong></td>
                                    <td><strong>Edit</strong></td>
                                    <td><strong>Delete</strong></td>
                                </tr
                                <logic:notPresent name="userList" scope="request">
                                    <tr>
                                        <td colspan="9"> No records Found </td>
                                    </tr>
                                </logic:notPresent>
                                <logic:present name = "userList" scope="request">
                                    <logic:iterate id="users" name="userList" scope="request">
                                        <tr>
                                            <td><bean:write name="users" property="userId"/></td>
                                            <td><bean:write name="users" property="fullName"/></td>
                                            <td><bean:write name="users" property="emailId"/></td>
                                            <td><bean:write name="users" property="accountCreatedOn"/></td>
                                            <td><bean:write name="users" property="accountStatus"/></td>
                                            <td>[<a href="./userAccount.do?action=showEditUserInfo&userId=<bean:write name="users" property="userId"/>" >Edit</a>]</td>
                                            <td><a href="./userAccount.do?action=deleteUserInfo&userId=<bean:write name="users" property="userId"/>">Delete</a></td>
                                        </tr>
                                    </logic:iterate>                                        
                                </logic:present>
                            </table>
                        </td>
                    </tr>
                </table>
                <div id="pageNavPosition" align="center"></div>

                <script type="text/javascript"><!--
                    var pager = new Pager('results', 10);
                    pager.init();
                    pager.showPageNav('pager', 'pageNavPosition');
                    pager.showPage(1);
                    //--></script>
            </td>
        </table>

    </body>
</html>
